//
//  RegisterViewController.m
//  OAProject
//
//  Created by yhj on 2017/7/10.
//  Copyright © 2017年 cdnunion. All rights reserved.
//

#import "RegisterViewController.h"

@interface RegisterViewController ()

@end

@implementation RegisterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

#define textFieldH     50

    UIView *bgView=[[UIView alloc]initWithFrame:CGRectMake(0,74,APPW,textFieldH*4)];
    bgView.backgroundColor=WhiteColor;
    [self.view addSubview:bgView];

    NSArray *placeholderArr=@[@"手机号码",@"密码",@"验证码",@"邀请码"];
    for (NSInteger i=0;i<placeholderArr.count;i++)
    {
        UITextField *textTF=[[UITextField alloc]initWithFrame:CGRectMake(kmargin*2,(i%placeholderArr.count)*textFieldH,APPW-kmargin*4,textFieldH)];
        textTF.placeholder=placeholderArr[i];
        textTF.tag=2000+i;
        textTF.textColor=LightGreyColor;
        [bgView addSubview:textTF];

        if (i!=3)
        {
            UIView *lineView=[[UIView alloc]initWithFrame:CGRectMake(kmargin*2,49+(i%placeholderArr.count)*textFieldH,APPW,1)];
            lineView.backgroundColor=LightGreyColor;
            [bgView addSubview:lineView];
        }
        if (i==2)
        {
            UIButton *submitBtn=[AppUI createButtonWithText:@"获取验证码" andWithTextColor:MainColor andWithFontfloat:16 andWithBtnAction:^{

            }];
            ViewBorderRadius(submitBtn,kmargin,1,MainColor);
            [bgView addSubview:submitBtn];
            submitBtn.frame=CGRectMake(APPW*2/3,kmargin+textFieldH*2,APPW/3-kmargin,kmargin*3);
        }
    }

    UILabel *label=[self.view getLabelWithText:@"我已满18岁并同意<<用户服务及隐私条款>>" font:FontNumber(14) textColor:DarkGreyColor textAlignment:NSTextAlignmentLeft lineBreakMode:NSLineBreakByTruncatingTail numberOfLines:1];
    label.frame=CGRectMake(kmargin*4,CGRectGetMaxY(bgView.frame)+kmargin*2,APPW-100,30);
    [self.view addSubview:label];


    UIButton *submitBtn=[AppUI createButtonWithText:@"注册" andWithTextColor:WhiteColor andWithFontfloat:18 andWithBtnAction:^{

    }];
    submitBtn.backgroundColor=MainColor;
    ViewBorderRadius(submitBtn,kmargin,1,ClearColor);
    [self.view addSubview:submitBtn];
    submitBtn.frame=CGRectMake(kmargin*2,CGRectGetMaxY(label.frame)+kmargin*2,APPW-kmargin*4,kmargin*4);
}


@end
